package top.wyloop.intoeins.module.ledger.model.form;

import lombok.Data;
import top.wyloop.intoeins.module.ledger.model.entity.Account;

/**
 * @author Wyatt6
 * @date 2025/3/28
 */
@Data
public class AccountForm {
    private Long id;            // 主键
    private Long userId;        // 用户ID
    private String name;        // 记账账户名称
    private Boolean activated;  // 激活标志
    private Long sortId;        // 排序ID

    public Account convert() {
        Account account = new Account();

        account.setId(id);
        account.setUserId(userId);
        account.setName(name != null ? name.trim() : null);
        account.setActivated(activated);
        account.setSortId(sortId);

        return account;
    }
}
